# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt

img = plt.imread(r'D:\workspaces\me\python-algrithom\ch03\jfm.jpg')

plt.imshow(img)
print(img)
print(type(img))
print(img.shape)
print(img[2000:2500,200:1000,:])
height,width,length = img.shape
img1 = img.copy()
for h in range(height):
    for w in range(width):
        for l in range(length):
            if img1[h,w,l] >= 127:
                img1[h,w,l] = 255
            else:
                img1[h,w,l] = 0
plt.imshow(img1)
